<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head th:replace="common::head"></head>
<body>
<div th:replace="common::top"></div>
<br/>
<h2>用户列表</h2>
<a href="user/add.html" th:href="@{/user/add.html}">新增</a>
<br/>
<table>
    <thead>
    <tr>
        <th>序号</th>
        <th>用户</th>
<!--        <th>密码</th>-->
        <th>启用</th>
        <th>角色</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="item : ${page.getList()}">
        <td th:text="${itemStat.index+1}"></td>
        <td th:text="${item.getUsername()}"></td>
<!--        <td th:text="${item.getPassword()}" style="word-break: break-word; width: 200px;"></td>-->
        <td th:text="${item.isEnabled()}"></td>
        <td th:text="${item.getAuthorities()}"></td>
        <td><a th:href="@{edit.html(userName=${item.getUsername()})}">编辑</a></td>
    </tr>
    </tbody>
</table>
<div>
    <a><b th:text="'第 '+${page.curPage}+'/'+${page.getLastPage()}+' 页'"></b></a>
    <a th:href="@{/user/list.html(page=${page.getFirstPage()})}">首页</a>
    <a th:if="${page.getPrePage()>0}"
       th:href="@{/user/list.html(page=${page.getPrePage()})}">上一页</a>
    <a th:if="${page.getNextPage()>0}"
       th:href="@{/user/list.html(page=${page.getNextPage()})}">下一页</a>
    <a th:href="@{/user/list.html(page=${page.getLastPage()})}">尾页</a>
</div>
<p><a href="../index.html" th:href="@{/index.html}">返回主页</a></p>
</body>
</html>